        TTL     > TOS12 - The end is nigh !

        ORG     fixedcode

        &       langcommand             ; So we can easily find it

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; b7 -> end of word marker, b6 -> can be followed, b5..0 = cmdno

follow * &40

comtable
        =       "GO"   , !&03 + follow  ; (*G.)
        =       "HELP" , !&02           ; (*H.)
        =       "OS"   , !&04           ; (*OS)
        =       "PAGE" , !&05 + follow  ; (*P.)
        =       "QUIT" , !&01           ; (*Q.)
langcommand
        =       "BASIC", !&00           ; (*B.)
        =       0

        %       langcommand+32+1+1-.    ; allow longer names to be patched in


 ASSERT . <= &FFB6

        %       &FFB6-.                 ; Pad out to next fixed area

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
; The really fixed area: must be present in all cases

 ASSERT . = &FFB6

        =       veclen
        &       vecsstart

osrdrm  JMP     badbrk
rawvdu  JMP     badbrk
oseven  JMP     badbrk

        JMP     badbrk  ; gsinit
        JMP     badbrk  ; gsread
        JMP     tim_rdch ; nvrdch
        JMP     tim_wrch ; nvwrch
osfind  JMI     findv
osgbpb  JMI     gbpbv
osbput  JMI     bputv
osbget  JMI     bgetv
osargs  JMI     argsv
osfile  JMI     filev
osrdch  JMI     rdchv
osasci  CMPIM   CR
        BNE     oswrch
osnewl  LDAIM   LF
        JSR     oswrch
        LDAIM   CR
oswrch  JMI     wrchv
osword  JMI     wordv
osbyte  JMI     bytev
oscli   JMI     cliv

        &       nmi_reallygo            ; NMI abused on emulator
        &       reset
        &       irqbrk


codelength * .-origin

; +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 [ . <> 0
 ! 1, "6502 emulator TOS is the wrong length"
 ]

        END
